#ifndef DISJOINT_SET_H
#define DISJOINT_SET_H

#include <vector>
using std::vector;

class DisjointSet {
private:
    vector<int> parent;
    bool bs; // union by size
public:
    DisjointSet(int size, bool bs=false) : bs(bs), parent(size, -1) {}
    void djs_union(int x, int y);
    int find(int x);
};

#endif //DISJOINT_SET_H
